<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/pages/common/header.jsp"%>
<jdf:themeFile file="jquery.jqGrid.css"/>
<jdf:themeFile file="jqGrid/i18n/grid.locale-cn.js" />
<jdf:themeFile file="jqGrid/jquery.jqGrid.src.js" />
<jdf:themeFile file="fckeditor/fckeditor.js" />
<jdf:themeFile file="business/packing${template}.js" />
</head>
<body>
	<div class="contentBody contentborder">
		<div class="tab-pane" id="tabPane">
			<div id="message">${message}</div>
			<div class="tab-page" id="tabPage1">
				<h1 class="tab">装箱单管理</h1>
				<div class="contentborder tableForm">
					<jdf:form bean="entity" scope="request">
						<form action="${dynamicDomain}/packing/save?action=${param.action}" method="post" id="Order">
							<input type="hidden" name="id">
							<input type="hidden" name="objectId">
							<input type="hidden" name="companyId">
							<input type="hidden" name="customerId" id="customerId">
							<input type="hidden" name="commercialInvoiceId" id="commercialInvoiceId">
							<input type="hidden" name="status" id="status">
							<input type="hidden" name="packingDate">
							<table class="inputTable">
							    <tr>
									<td class="label cancelBorderLeft" style="width: 100px;">
										<label for="orderId">订单：</label>
									</td>
									<td class="content" colspan="3">
										<input type="hidden" name="orderId" id="orderId">
										<input type="text" name="orderNo" id="orderNo" value="${orderNo}" size="70" readonly="readonly"/>
										<a href="${dynamicDomain}/order/selectToPacking?ajax=1&customerId=${entity.customerId}" class="colorbox">选择</a>
									</td>
								</tr>
								<tr>
								    <td class="label cancelBorderLeft">
                                        <label for="blNo">提单编号：</label>
                                    </td>
                                    <td class="content">
                                        <input type="text" name="blNo">
                                    </td>
                                    <td class="label">
										<label for="commercialInvoiceNo">发票编号：</label>
									</td>
									<td class="content">
										<input type="text" name="commercialInvoiceNo" id="commercialInvoiceNo" readonly="readonly"/>
                                        <a href="${dynamicDomain}/commercialInvoice/selectToPacking?ajax=1&customerId=${entity.customerId}" class="colorbox">选择</a>
									</td>
								</tr>
								<tr>
								    <td class="label cancelBorderLeft">
                                        <label for="type">运输类型：</label>
                                    </td>
                                    <td class="content" colspan="3">
                                        <select name="type" id="type">
                                        	<option value=""></option>
											<jdf:select dictionaryId="1004"/>
										</select>
										<input type="text" name="byOthers" id="byOthers" style="display: none;">
                                    </td>
								</tr>
								<tr>
                                    <td class="label cancelBorderLeft">
                                        <label for="shipName">轮船名称：</label>
                                    </td>
                                    <td class="content">
                                       <input type="text" name="shipName">
                                    </td>
                                    <td class="label">
                                        <label for=eta>ETA：</label>
                                    </td>
                                    <td class="content">
                                        <input type="text" name="eta" size="12" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label cancelBorderLeft">
                                        <label for="sealNo">封条号码：</label>
                                    </td>
                                    <td class="content">
                                       <input type="text" name="sealNo">
                                    </td>
                                    <td class="label">
                                        <label for=containerNo>柜号：</label>
                                    </td>
                                    <td class="content">
                                        <input type="text" name="containerNo">
                                    </td>
                                </tr>
                                <tr>
                                     <td class="label cancelBorderLeft">
                                        <label for="realTotalGrossWeight">实际总毛重：</label>
                                    </td>
                                    <td class="content" colspan="3">
                                       <input type="text" name="realTotalGrossWeight">
                                    </td>
                                </tr>
								<tr>
									<td class="label cancelBorderLeft">
										<label for="remark">备注：</label>
									</td>
									<td class="content" colspan="3">
										<textarea rows="3" cols="50" name="remark"></textarea>
										<script type="text/javascript">
                                            var txt = new FCKeditor("remark");
                                            txt.BasePath = "<%=DomainUtils.getStaticDomain()%>js/fckeditor/";
                                            txt.Config["CustomConfigurationsPath"]="<%=DomainUtils.getStaticDomain()%>js/fckeditor/myconfig.js";
                
                                            txt.ToolbarSet="Simple";
                                            txt.Height= 300;
                                            txt.Width = "98%";
                                            txt.ReplaceTextarea();
                                        </script>
									</td>
								</tr>
							</table>
						</form>
					</jdf:form>
					<div style="margin: 1px;">
						<table id="orderItemsTable"></table>
						<div id="pager"></div>
					</div>
					<div class="right" style="margin: 2px;">
						<c:if test="${empty entity.status || entity.status == 1}">
							<button type="button" onclick="$('#status').val(1);$('#Order').submit();" class="submit_button">保存草稿</button>
						</c:if>
						<c:if test="${(view!=1 && (entity.status <20))||param.action=='page'}">
							<button type="button" onclick="$('#status').val(10);$('#Order').submit();" class="submit_button">提交</button>
						</c:if>
						<c:if test="${not empty message}">
						<button type="button" onclick="toUrl('${dynamicDomain}/packing/create?action=${param.action}')">继续增加</button>
						</c:if>
						<c:choose>
							<c:when test="${param.action=='page'}">
								<button type="button" onclick="toUrl('${dynamicDomain}/packing/back')">返回</button>
							</c:when>
							<c:otherwise>
								<button type="button" onclick="toUrl('${dynamicDomain}/packing/${param.action}')">返回</button>
							</c:otherwise>
						</c:choose>
					</div>
				</div>
			</div>
		</div>
	</div>
	<jdf:tableLabelValidate domain="Packing"/>
	<script type="text/javascript">
	var packingId = "${entity.objectId}";
    var packingEditable = true;
    var units = "";
    <c:forEach varStatus="num" var="item" items="${units}">
    units+="${item.value}:${item.name};";
    </c:forEach>
    units=units.substring(0,units.length-1);
    
    function setOrders(orderIds,orderNos){
    	var currentIds = $("#orderId").val();
    }
	</script>
</body>
</html>